//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class PhoneticProperties: IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read("phoneticPr"))
            {
                FontId = c.GetString("fontId");
                Type = c.GetOptionalEnum<PhoneticType>("type", PhoneticType.FullWidthKatakana);
                Alignment = c.GetOptionalEnum("alignment", PhoneticAlignment.Left);
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("phoneticPr"))
            {
                c.SetString("fontId", FontId);
                c.SetOptionalEnum("type", Type, PhoneticType.FullWidthKatakana);
                c.SetOptionalEnum("alignment", Alignment, PhoneticAlignment.Left);
            }
        }

        #endregion

        public string FontId { get; set; }

        public PhoneticType Type { get; set; }

        public PhoneticAlignment Alignment { get; set; }
    }
}
